Vue.component('Detail', {
	template: `
		<el-dialog title="查看详情" width="1000px" class="icon-dialog" :visible.sync="show" @open="open" :before-close="closeForm" append-to-body>
			<div id="detail">
			<table cellpadding="0" cellspacing="0" class="table table-bordered" align="center" width="100%" style="word-break:break-all; margin-bottom:30px;  font-size:13px;">
				<tbody>
					<tr>
						<td class="title" width="100">需求标题：</td>
						<td>
							{{form.require_title}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">学生姓名：</td>
						<td>
							{{form.children_name}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">学生年级：</td>
						<td>
							{{form.require_grade}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">辅导学科：</td>
						<td>
							{{form.require_subject}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">当前学习水平：</td>
						<td>
							{{form.current_learning}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">期望达到目标：</td>
						<td>
							{{form.expect_learning}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">期望授课开始时间：</td>
						<td>
							{{form.expect_start_time}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">期望授课结束时间：</td>
						<td>
							{{form.expect_end_time}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">期望授课频次：</td>
						<td>
							<span v-if="form.expect_frequency == '1'">每周1次</span>
							<span v-if="form.expect_frequency == '2'">每周2次</span>
							<span v-if="form.expect_frequency == '3'">每周3次</span>
							<span v-if="form.expect_frequency == '4'">每天</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">授课时长：</td>
						<td>
							{{form.teach_hour}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">授课地点：</td>
						<td>
							{{form.teach_address}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">授课地点详情：</td>
						<td>
							{{form.teach_address_detail}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">授课地点经度：</td>
						<td>
							{{form.teach_address_lng}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">授课地点维度：</td>
						<td>
							{{form.teach_address_lat}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">老师性别要求：</td>
						<td>
							<span v-if="form.require_teacher_sex == '0'">无要求</span>
							<span v-if="form.require_teacher_sex == '1'">男</span>
							<span v-if="form.require_teacher_sex == '2'">女</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">教学经验要求：</td>
						<td>
							<span v-if="form.require_teacher_year == '0'">无要求</span>
							<span v-if="form.require_teacher_year == '1'">1年以上</span>
							<span v-if="form.require_teacher_year == '2'">3年以上</span>
							<span v-if="form.require_teacher_year == '3'">5年以上</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">年龄偏好最小：</td>
						<td>
							{{form.require_teacher_year_min}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">年龄偏好最大：</td>
						<td>
							{{form.require_teacher_year_max}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">其他要求：</td>
						<td>
							{{form.require_other}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">课时费：</td>
						<td>
							{{form.class_fee}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">预估课时：</td>
						<td>
							{{form.estimated_hour}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">联系人：</td>
						<td>
							{{form.link_name}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">联系人手机号：</td>
						<td>
							{{form.link_mobile}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">需求状态：</td>
						<td>
							<span v-if="form.require_status == '0'">草稿</span>
							<span v-if="form.require_status == '1'">已发布</span>
							<span v-if="form.require_status == '2'">招募中</span>
							<span v-if="form.require_status == '4'">已关闭</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">审核状态：</td>
						<td>
							<span v-if="form.cert_status == '0'">待审核</span>
							<span v-if="form.cert_status == '1'">审核成功</span>
							<span v-if="form.cert_status == '2'">审核失败</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">审核时间：</td>
						<td>
							{{parseTime(form.cert_time)}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">发布人：</td>
						<td>
							<span v-if="form.parent_name">{{form.parent_name}}</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">发布时间：</td>
						<td>
							{{parseTime(form.create_time)}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">更新时间：</td>
						<td>
							{{parseTime(form.update_time)}}
						</td>
					</tr>
				</tbody>
			</table>
			</div>
		</el-dialog>
	`
	,
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
			form:{
			},
		}
	},
	methods: {
		open(){
			axios.post(base_url+'/Parents.Requirement/detail',this.info).then(res => {
				this.form = res.data.data
			})
		},
		closeForm(){
			this.$emit('update:show', false)
		}
	}
})
